<!-- 头部 -->
<include file="Public:header" />

        <link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/sishu_teacher_index.css"
        media="all">
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/sishu_teacher_base.css"
        media="all">
        <link href="__PUBLIC__/home/css/header2_9.css" rel="stylesheet" type="text/css"
        media="all">

        <style type="text/css">
            .calendar{position:absolute;width:150px!important;width /**/:152px;height:194px!important;height
            /**/:184px;background-color:#ffffff;border:1px solid #f90;left:0px;top:0px;z-index:9999;}
            .cdrHeader{background-color:#f90;width:150px;height:22px;font-size:12px;color:#ffffff;}
            .cdrWatermark{position:absolute;left:0px;top:90px;width:140px;font-family:
            Arial Black;font-size:50px;color:#d4d4d4;z-index:1;text-align:center;}
            .cdrBodyBar{background-color:#f4f4f4;font-size:12px;color:#000000;width:148px;height:20px;}
            .cdrBody{width:140px;height:122px!important; height /**/:110px;font-size:12px;cursor:pointer;color:#000000;}
            .dayOver{height:16px;padding:0px;border:1px solid black;background-color:#f4f4f4;}
            .dayOut{padding:1px;border:none;height:16px;} .menuOver{background-color:#f90;color:#ffffff;font-size:12px;}
            .headerOver{border:1px solid black;background-color:#f4f4f4;color:black;cursor:default;}
            .cdrMenu{font-size:12px;border:1px solid #000000;background-color:#ffffff;cursor:default;width:100%}
            html>body #Calendar{width:142px;174px;}
        </style>
            <div class="mian_nav">
                <div class="mycenter">
                    <div class="nav_box">
                        <ul>
    <li class="home"><a href="{:U('index/index',array('newcity'=>$city))}" target="_self">首页</a></li>
    <li><a href="{:U('index/jiazhang_zn',array('newcity'=>$city))}" target="_self">学员指南</a></li>
    <li><a href="{:U('index/laoshi_zn',array('newcity'=>$city))}" target="_self">老师指南</a></li>
    <li><a href="{:U('index/about',array('newcity'=>$city))}" target="_self">关于平台</a></li>
                        </ul>
                        <div class="nav-line" style="left:92px;width:64px;">
                        </div>
                    </div>
                </div>
            </div>
        </header>
        <div class="auto1200">
            <div class="jz_main fl ">
                <style>
                    .qrtop { width: 100%; padding: 60px 0 0; display: inline-block; } .qrtop
                    div{ display: inline-block; width: 100%; } .qrtop span { width: 20%; float:
                    left; text-align: right; font-size: 20px; line-height: 40px; height: 40px;
                    } .qrtop input { width: 75%; float: right; text-align: left; height: 40px;
                    line-height: 40px; margin-right: 3%; text-indent: 1em; } .qrtop textarea{
                    width: 75%; height: 100px; max-height: 130px; border: 1px solid #abadb3;
                    padding: 15px; float: right; margin-right: 3%; } .xk_ceng_twoBtn{ height:
                    50px; }
                </style>
                <div class="t_content">
                    <div class="tab1" id="tab1">
                        <div class="menu">
                            <ul id="control_childrenPages">
                                <a href="{:U('laoshi/laoshi_core',array('newcity'=>$city))}"><li id="one1" class="off"><div class="bg1"></div>预约订单</li></a>
                                <a href="{:U('laoshi/laoshi_core_order',array('newcity'=>$city))}"><li id="one1"><div class="bg1"></div>我的课程</li></a>
                                <!-- <a href="{:U('laoshi/laoshi_core_zhanghao',array('newcity'=>$city))}"><li id="one1"><div class="bg1"></div>我的账户</li></a> -->
                            </ul>
                            <div class="clear">
                            </div>
                        </div>
                        <div class="menudiv" id="childrenPages">
                            <div class="con" style="display: block;" name="con" id="con_one_1">
                                <table class="table0 table1" cellpadding="0" cellspacing="0">
                                    <tbody>
                                        <tr>
                                            <th>预约号</th>
                                            <th>学生姓名</th>
                                            <th>年级类别</th>
                                            <th width="10%">科目</th>
                                            <th width="10%">联系课程顾问</th>
                                            <th width="20%">试听时间</th>
                                            <th width="10%">试听地点</th>
                                            <th width="20%">进度</th>
                                            <th>操作</th>
                                        </tr>
                                        <?php foreach ($yuyues as $y) { ?>
                                        <tr>
                                            <th style="background:#fff;">{$y.id}</th>
                                            <th style="background:#fff;">{$y.name}</th>
                                            <th width="10%" style="background:#fff;">{$y.grade}</th>
                                            <th width="10%" style="background:#fff;">{$y.subject}</th>
                                            <th width="10%" style="background:#fff;">18902491208</th>
                                            <th width="20%" style="background:#fff;">{$y.date} {$y.time}</th>
                                            <th width="10%" style="background:#fff;">{$y.city_quyu}</th>
                                            <?php if ($y['is_laoshi_on']==1) { ?>
                                                <th width="20%" style="background:#fff;">老师已接受,尽快联系课程顾问</th>
                                            <?php }else { ?> 
                                                <th width="20%" style="background:#fff;">等待老师接受</th>
                                            <?php } ?>
                                            <td>
                                                <?php if ($y['is_laoshi_on']==0) { ?>
                                                    <a title="接受" href="javascript:;" class="p_st_cancel" onclick="jieshou_on(this,'{$y['id']}')" >接受</a>
                                                <?php }else{ ?>
                                                <a title="删除" href="javascript:;" class="p_st_cancel" onclick="commemt_del(this,'{$y['id']}')" >取消</a>
                                                <?php } ?>
                                            </td>
                                        </tr>
                                        <?php } ?>
                                    </tbody>
                                    <table class="table0 table1" cellpadding="0" cellspacing="0">
                            </div>
                            <div style="display: none;" class="con" name="con" id="con_one_3">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script>
            layui.use(['element','laypage','layer','form'], function(){
                $ = layui.jquery;//jquery
              lement = layui.element();//面包导航
              laypage = layui.laypage;//分页
              layer = layui.layer;//弹出层
              form = layui.form();//弹出层

          })
            
            /*接受*/
            function jieshou_on(obj,id){
                layer.confirm('确认要接受吗？',function(index){
                    //发异步删除数据
                    id = id;
                    $.ajax({
                        url: "{:U('laoshi/jieshou_on')}",//请求地址
                        type: "post",//请求方式
                        dataType: "json",//返回数据类型
                        data: {id:id},//发送的参数
                        })
                        .done(function(response) {
                              if(response.error==1){
                                layer.msg(response.info ,{icon:6});
                                location.reload();
                              }else{
                                layer.msg(response.info ,{icon:5});
                              }
                          })
                        .fail(function() {
                            alert("ajxs交互失败");
                        })  
                    return false;
                });
            }
            /*删除*/
            function commemt_del(obj,id){
                layer.confirm('确认要删除吗？',function(index){
                    //发异步删除数据
                    id = id;
                    $.ajax({
                        url: "{:U('laoshi/ls_order_del')}",//请求地址
                        type: "post",//请求方式
                        dataType: "json",//返回数据类型
                        data: {id:id},//发送的参数
                        })
                        .done(function(response) {
                              if(response.error==1){
                                layer.msg(response.info ,{icon:6});
                                $(obj).parents("tr").remove();
                              }else{
                                layer.msg(response.info ,{icon:5});
                              }
                          })
                        .fail(function() {
                            alert("ajxs交互失败");
                        })  
                    return false;
                });
            }
            </script>
    </body>

</html>